﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ADL;

namespace CDIO.Controllers
{

    public class LoginController : Controller
    {
        //
        // GET: /Login/

        public ActionResult Login()
        {
            return View();
        }

        [HttpPost]
        public ActionResult verify(string Username, string Psw)
        {
            ADL_admin ad = new ADL_admin();
            _admin _ad = new _admin();
            _ad._admin_name = Username;
            _ad._admin_psw = Psw;
            if (ad.search(_ad, "_admin_name") != null)
            {
                return Json(new { Result = true, Message = "登录成功" });
            }

            return Json(new { Result = false, Message = "账号或密码错误" });
        }
    }
}
